(function() {

  window.Observable = (function() {

    function Observable() {
      this.events = [];
    }

    Observable.prototype.bind = function(type, fnc) {
      if (!this.events[type]) {
        this.events[type] = [];
      }
      return this.events[type].push(fnc);
    };

    Observable.prototype.unbind = function(type, fnc) {
      if (this.events[type]) {
        return this.events[type].each(function(elem, index, arr) {
          if (elem === fnc) {
            return this.events[type].splice(index, 1);
          }
        });
      }
    };

    Observable.prototype.notify = function(type, args) {
      var x;
      x = true;
      if (this.events[type]) {
        this.events[type].each(function(elem, index, arr) {
          return x = x && elem(args);
        });
      }
      return x;
    };

    return Observable;

  })();

}).call(this);
